package com.aletto.general_store.ui.adapters;

import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.aletto.general_store.R;
import com.aletto.general_store.data.model.Goods;
import com.aletto.general_store.data.model.StoreFavorites;
import com.aletto.general_store.utils.XHelper;
import com.aletto.general_store.utils.image.GlideApp;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import java.util.List;

public class FavoritesStoreAdapter extends BaseQuickAdapter<StoreFavorites, BaseViewHolder> {

    public FavoritesStoreAdapter() {
        super(R.layout.item_browser_history);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder holder, StoreFavorites item) {
        holder.setText(R.id.tv_price_unit, item.getName());
//                .setText(R.id.tv_price_unit, goods.getPriceUnit());
//
        // 加载图片
        ImageView ivGoodsCover = holder.getView(R.id.iv_goods_cover);
        GlideApp.with(ivGoodsCover)
                .load(item.getHead_img())
                .goodsGrid()
                .into(ivGoodsCover);
    }

}
